/**
 * Copyright (C) 2013 AirChina
 *
 * @className:com.airchina.wechat.frontend.FrontendConfig
 * @description:
 * 
 * @version:v1.0.0 
 * @author:larry
 * 
 * Modification History:
 * NO   Date         Author      Version     Description
 * -----------------------------------------------------------------
 *     2013-10-21     larry       v1.0.0        create
 *
 *
 */
package com.china.api.wechat;

import com.typesafe.config.Config;
import com.typesafe.config.ConfigFactory;
import com.typesafe.config.ConfigParseOptions;
import com.typesafe.config.ConfigResolveOptions;
import com.typesafe.config.ConfigSyntax;

/**
 * @Description:
 * @author:larry
 * @version:v1.0.0
 * @Created:2013-10-21下午5:11:33
 * @Modified:
 */
public class FrontendConfig {

	private static Config config = ConfigFactory.load("frontend.properties", ConfigParseOptions.defaults().setSyntax(ConfigSyntax.CONF).setAllowMissing(false), ConfigResolveOptions.defaults()
			.setUseSystemEnvironment(false));
	
	private static Config wechat = ConfigFactory.load("wechat.properties", ConfigParseOptions.defaults().setSyntax(ConfigSyntax.PROPERTIES).setAllowMissing(false), ConfigResolveOptions.defaults()
			.setUseSystemEnvironment(false));

	public static void main(String[] args) {
		System.out.println(getRedisServers()[0]);
	}
	
	public static String getMyOpenId(){
		return config.getString("myOpenId");
	}
	
	public static String getSizeMonth(){
		return config.getString("sizeMonth");
	}

	public static String[] getRedisServers() {
		return config.getStringList("redis").toArray(new String[]{});
	}

	public static int getSessionTimeOut() {
		return config.getInt("sessionTimeOut");
	}
	
	public static String getCheckInOther() {
		return wechat.getString("CHECK_IN_OTHER");
	}
	
	public static String getCheckInNoDataStart() {
		return wechat.getString("CHECK_IN_NODATA_START");
	}
	
	public static String getCheckInNoDataEnd() {
		return wechat.getString("CHECK_IN_NODATA_END");
	}
	
	public static String getCityMilliariumCity() {
		return wechat.getString("CITY_MILLIARIUM_CITY");
	}
	
	public static String getCityMilliariumResult() {
		return wechat.getString("CITY_MILLIARIUM_RESULT");
	}
	
	public static String getTicketParameter() {
		return wechat.getString("TICKET_PARAMETER");
	}
	
	public static String getTicketParameterError() {
		return wechat.getString("TICKET_PARAMETER_ERROR");
	}
	
	public static String getOpinionPromptOne() {
		return wechat.getString("OPINION_PROMPT_ONE");
	}
	
	public static String getOpinionPromptTwo() {
		return wechat.getString("OPINION_PROMPT_TWO");
	}
	
	public static String getURL() {
		return wechat.getString("URL");
	}	
	
	public static String getError() {
		return wechat.getString("ERROR");
	}	
	
	
	public static String getTimeStr() {
		return config.getString("timeStr");
	}
	
	public static String getEmpId() {
		return config.getString("empId");
	}
	
	public static String getDeviceId() {
		return config.getString("deviceId");
	}
	
	public static String getCheckCode() {
		return config.getString("checkCode");
	}
	
	public static String getOsType() {
		return config.getString("osType");
	}
}
